import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '标题',
    align: 'center',
    dataIndex: 'title',
  },
  {
    title: '发布时间',
    align: 'center',
    dataIndex: 'time',
  },
  {
    title: '来源',
    align: 'center',
    dataIndex: 'src',
  },
  {
    title: '图片',
    align: 'center',
    dataIndex: 'pic',
  },
  {
    title: 'url',
    align: 'center',
    dataIndex: 'url',
  },
  {
    title: 'content',
    align: 'center',
    dataIndex: 'content',
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: 'newTime',
    field: 'newTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  {
    label: '来源',
    field: 'src',
    component: 'Input',
  },
  {
    label: '图片',
    field: 'pic',
    component: 'Input',
  },
  {
    label: 'url',
    field: 'url',
    component: 'Input',
  },
  {
    label: 'weburl',
    field: 'weburl',
    component: 'Input',
  },
  {
    label: 'content',
    field: 'content',
    component: 'JEditor',
    defaultValue: '',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  newTime: {title: 'newTime',order: 0,view: 'datetime', type: 'string',},
  src: {title: '来源',order: 1,view: 'text', type: 'string',},
  pic: {title: '图片',order: 2,view: 'text', type: 'string',},
  url: {title: 'url',order: 3,view: 'text', type: 'string',},
  weburl: {title: 'weburl',order: 4,view: 'text', type: 'string',},
  content: {title: 'content',order: 5,view: 'textarea', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}